﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Tradex.Trading;

namespace Tradex.Messages {

    /// <summary>
    /// This message is sent from a Connector to the TradingService (and from the TradingService forward to
    /// whoever is interested). It informs the receiver of the result of an order modification or cancel request.
    /// 
    /// TODO: try to work around that one. Is it really necessary to have this? Rithmic has it... but do we need it,
    /// or can we not assume a cancel or modifacation "just worked"?
    /// </summary>
    [Serializable ()]
    public sealed class OrderModificationResponseMessage : Message {

        /// <summary>
        ///  Public Constructor.
        /// </summary>
        public OrderModificationResponseMessage() {
        }

        /// <inheritdoc />
        public override MessageCode Code { get { return MessageCode.OrderModificationResponse; } }

        /// <summary>
        /// Gets the Orderkey, which uniquely identifies an order.
        /// </summary>
        public OrderKey OrderKey { get; private set; }

        /// <summary>
        /// Gets the Orderid, which identifies in the context of a connection.
        /// </summary>
        public OrderId ConnectionKey { get; private set; }

        /// <summary>
        /// This is the requested modification. A null value at this structure results in a cancel (as it logically
        /// turns the requested values to invalid).
        /// </summary>
        public OrderModification Modification { get; private set; }

        /// <summary>
        /// Gets the indication whether the modification was a success or not.
        /// </summary>
        public bool Success { get; private set; }

    }

}
